From 5f3c263950396cfec3b777706fba324ecc02a566 Mon Sep 17 00:00:00 2001 From: Alex Williamson Date: Mon, 4 Jun 2007 14:16:21 -0600 Subject: [PATCH] [IA64] Use vcpu_get_psr instead of vcpu_get_ipsr_int_state. Signed-off-by: Tristan Gingold --- xen/arch/ia64/xen/faults.c | 4 ++-- xen/arch/ia64/xen/vcpu.c | 26 ++------------------------ xen/include/asm-ia64/vcpu.h | 1 - 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/xen/arch/ia64/xen/faults.c b/xen/arch/ia64/xen/faults.c index cf50f94424..0d04b21e9b 100644 --- a/xen/arch/ia64/xen/faults.c +++ b/xen/arch/ia64/xen/faults.c @@ -84,7 +84,7 @@ static void reflect_interruption(unsigned long isr, struct pt_regs *regs, check_bad_nested_interruption(isr, regs, vector); PSCB(v, unat) = regs->ar_unat; // not sure if this is really needed? PSCB(v, precover_ifs) = regs->cr_ifs; - PSCB(v, ipsr) = vcpu_get_ipsr_int_state(v, regs->cr_ipsr); + PSCB(v, ipsr) = vcpu_get_psr(v); vcpu_bsw0(v); PSCB(v, isr) = isr; PSCB(v, iip) = regs->cr_iip; @@ -129,7 +129,7 @@ void reflect_event(void) regs->cr_ipsr, regs->cr_iip, isr, PSCB(v, iip)); PSCB(v, unat) = regs->ar_unat; // not sure if this is really needed? PSCB(v, precover_ifs) = regs->cr_ifs; - PSCB(v, ipsr) = vcpu_get_ipsr_int_state(v, regs->cr_ipsr); + PSCB(v, ipsr) = vcpu_get_psr(v); vcpu_bsw0(v); PSCB(v, isr) = isr; PSCB(v, iip) = regs->cr_iip; diff --git a/xen/arch/ia64/xen/vcpu.c b/xen/arch/ia64/xen/vcpu.c index 6a3b6c9aa4..4a6227515f 100644 --- a/xen/arch/ia64/xen/vcpu.c +++ b/xen/arch/ia64/xen/vcpu.c @@ -539,6 +539,8 @@ u64 vcpu_get_psr(VCPU * vcpu) /* Fool cpl. */ if (ipsr.ia64_psr.cpl < 3) newpsr.ia64_psr.cpl = 0; + else + newpsr.ia64_psr.cpl = 3; newpsr.ia64_psr.bn = PSCB(vcpu, banknum); @@ -552,30 +554,6 @@ IA64FAULT vcpu_get_psr_masked(VCPU * vcpu, u64 * pval) return IA64_NO_FAULT; } -u64 vcpu_get_ipsr_int_state(VCPU * vcpu, u64 prevpsr) -{ - u64 dcr = PSCB(vcpu, dcr); - PSR psr; - - //printk("*** vcpu_get_ipsr_int_state (0x%016lx)...\n",prevpsr); - psr.i64 = prevpsr; - psr.ia64_psr.pp = 0; - if (dcr & IA64_DCR_PP) - psr.ia64_psr.pp = 1; - psr.ia64_psr.ic = PSCB(vcpu, interrupt_collection_enabled); - psr.ia64_psr.i = !vcpu->vcpu_info->evtchn_upcall_mask; - psr.ia64_psr.bn = PSCB(vcpu, banknum); - psr.ia64_psr.dfh = PSCB(vcpu, vpsr_dfh); - psr.ia64_psr.dt = 1; - psr.ia64_psr.it = 1; - psr.ia64_psr.rt = 1; - if (psr.ia64_psr.cpl == 2) - psr.ia64_psr.cpl = 0; // !!!! fool domain - // psr.pk = 1; - //printk("returns 0x%016lx...\n",psr.i64); - return psr.i64; -} - BOOLEAN vcpu_get_psr_ic(VCPU * vcpu) { return !!PSCB(vcpu, interrupt_collection_enabled); diff --git a/xen/include/asm-ia64/vcpu.h b/xen/include/asm-ia64/vcpu.h index caf2be867d..04aeac96c5 100644 --- a/xen/include/asm-ia64/vcpu.h +++ b/xen/include/asm-ia64/vcpu.h @@ -41,7 +41,6 @@ extern IA64FAULT vcpu_set_ar(VCPU * vcpu, u64 reg, u64 val); extern IA64FAULT vcpu_get_ar(VCPU * vcpu, u64 reg, u64 * val); /* psr */ extern BOOLEAN vcpu_get_psr_ic(VCPU * vcpu); -extern u64 vcpu_get_ipsr_int_state(VCPU * vcpu, u64 prevpsr); extern u64 vcpu_get_psr(VCPU * vcpu); extern IA64FAULT vcpu_get_psr_masked(VCPU * vcpu, u64 * pval); extern IA64FAULT vcpu_reset_psr_sm(VCPU * vcpu, u64 imm); -- 2.30.2